package ee.tlnk.service;
 
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ee.tlnk.dao.AccountDAO;
import ee.tlnk.model.AccountModel;
 
 
/**
 * The Class AccountServiceImpl.
 */
@Service
public class AccountServiceImpl implements AccountService {
 
    /** The account dao. */
    @Autowired
    private AccountDAO accountDAO;
 
    /* (non-Javadoc)
     * @see ee.tlnk.service.AccountService#addAccount(ee.tlnk.model.AccountModel)
     */
    @Transactional
    public void addAccount(AccountModel account) {
    	accountDAO.addAccount(account);
    }
 
    /* (non-Javadoc)
     * @see ee.tlnk.service.AccountService#listAccount()
     */
    @Transactional
    public List<AccountModel> listAccount() {
 
        return accountDAO.listAccount();
    }
 
    /* (non-Javadoc)
     * @see ee.tlnk.service.AccountService#removeAccount(java.lang.Integer)
     */
    @Transactional
    public void removeAccount(Integer id) {
    	accountDAO.removeAccount(id);
    }
}
